@import "variables.less";

h1 {
    height: 40px;
    white-space: nowrap;
    overflow: hidden;

    #h1 {
        display: inline-block;
        padding: 0;
        background: url("../images/logo.png?3") 10px center no-repeat;
        background-size: 120px;
        text-indent: -100px;
        width: 135px;
        height: 40px;
    }

    border-bottom: 1px solid @blockBorderColor;
}

.version {
    position: relative;
    top: -7px;
    vertical-align: bottom;
    font-size: 8pt;
    font-style: italic;
    color: @note2Color;
}

#version {
    &:extend(.version);

    padding: 5px;
    color: @linkColor;
}

#version:hover {
    color: @linkColorHover;
}

#menu {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: @menuWidth;
    margin: 0;
    padding: 0;
    border-right: 1px solid @blockBorderColor;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: @bgColor;
    z-index: 100;

    p {
        padding: 10px;
        border-bottom: none;
    }

    .links {
        background: @blockBgColor;
        border-bottom: 1px solid @blockBorderColor;
        padding: 0 10px 7px 10px;
    }

    .message {
        background: transparent;
        border: none;
        border-bottom: 1px solid @blockBorderColor;
        color: @note2Color;
    }
}

#filter-field {
    margin: 0;
    width: 100%;
}

.menu-list {
    // !important is here because we need to override
    border-bottom: 1px solid @blockBorderColor !important;
    padding: 0 !important;
    margin-bottom: 25px !important  ;
}

.menu-link {
    display: block;
    padding: 2px 10px;
    width: auto;
    height: 20px;
    line-height: 20px;
    color: @textColor;
    overflow: hidden;
    text-overflow: ellipsis;

    &.active {
        background: @lightBgColor;
        color: @linkColor;

        &:hover {
            background: @lightBgColorHover;
        }
    }
}

p#dbs {
    background: @blockBgColor;
    color: @blockBgColor;
    font-size: 0;

    span {
        font-size: 0;
    }

    select {
        margin: 0;
        width: 100%;
    }
}

#tables {
    .menu-list();

    li {
        position: relative;

        &:hover {
            background: @menuHoverColor;
        }
    }

    a strong {
        font-weight: bold;
    }

    a.structure, a.view {
        .menu-link();
        padding-right: 0;
    }

    a.select {
        position: absolute;
        right: 0;
        top: 0;
        display: block;
        padding: 2px 7px;
        height: 20px;
        line-height: 20px;
        color: @noteColor;
        overflow: hidden;
        width: 16px;

        &:before {
            content: "📄  ";
            font-family: entypo, sans-serif;
            font-size: 24pt;
            line-height: 0;
            vertical-align: -3px;
        }

        &:last-child {
            position: relative;
            width: auto;
            padding-left: 10px;
            padding-right: 10px;
            color: @textColor;

            &:before {
                content: "";
            }
        }
    }

    li:first-of-type a {
        padding-top: 7px;
    }

    li:last-child a {
        padding-bottom: 7px;
    }

    a.active + a, a.active:last-child {
        background: @lightBgColor;
        color: @linkColor;
        font-weight: bold;

        &:hover {
            background: @lightBgColorHover;
        }
    }

    a.active:hover + a {
        background: @lightBgColorHover;
    }

    a:hover + a.active {
        background: @lightBgColorHover;
    }

    br {
        display: none;
    }
}

// AdminerSimpleMenu plugin
#tables.simple {
    a {
        .menu-link();
    }
}

#logins {
    .menu-list();

    a {
        .menu-link();
    }

    a:hover {
        background: @menuHoverColor;
    }

    a:first-of-type {
        padding-top: 7px;
    }

    a:last-of-type {
        padding-bottom: 7px;
    }

    br {
        display: none;
    }
}

@media only screen and (max-width: @mobileThreshold) {
    h1 {
        &:before {
            float: left;
            position: relative;
            left: 4px;
            top: 4px;
            width: 30px;
            height: 30px;
            content: "☰";
            font-family: "entypo", sans-serif;
            font-size: 32pt;
            line-height: 30px;
            border: 1px solid @lightBorderColor;
            border-radius: 2px;
            text-align: center;
            vertical-align: middle;
            background: @bgColor;
            cursor: pointer;
        }

        #h1 {
            margin-left: 10px;
        }
    }

    #menu {
        width: 40px;
        height: 40px;
        bottom: auto;
        border: none;
        overflow: hidden;
        background: transparent;

        form, p {
            display: none;
        }

        &.open {
            width: @menuWidth;
            height: auto;
            max-width: 100%;
            max-height: 100%;
            border-right: 1px solid @blockBorderColor;
            border-bottom: 5px solid @blockBorderColor;
            background: @bgColor;
            box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.03);
            z-index: 200;
            overflow-y: auto;

            form, p {
                display: block;
            }
        }
    }
}

@media only screen and (max-width: 270px) {
    #menu.open {
        border-right: none;
    }
}

// Retina
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (min-device-pixel-ratio: 1.5) {
    h1 #h1 {
        background-image: url("../images/logo-hres.png?3");
        background-size: 120px;
    }
}
